import INotifyVO from '@/model/vo/notify/INotifyVO'
import { getNameByValueAndDictList } from '@/util/CommonUtil'
import { IconRadio } from '@douyinfe/semi-icons'
import { OptionProps } from '@douyinfe/semi-ui/lib/es/select'

export default (dictList: OptionProps[]) => [
  { title: '标题', dataIndex: 'title' },
  {
    title: '通知类型',
    dataIndex: 'type',
    render: (text: any, record: INotifyVO, index: number) => {
      return getNameByValueAndDictList(dictList, record.type!)
    },
  },
  { title: '创建时间', dataIndex: 'createTime' },
  {
    title: '状态',
    dataIndex: 'readFlag',
    render: (text: any, record: INotifyVO, index: number) => {
      return (
        <IconRadio
          title={record.readFlag ? '消息已读' : '消息未读'}
          className={record.readFlag ? 'green' : 'red'}
        />
      )
    },
  },
]
